﻿
using System.Collections.Generic;

using Gola.VN.Scb.Web.Common.Models;

namespace Gola.VN.Scb.Web.Common.Entities
{
    public class CategoryEntity : BaseEntity
    {
        public int Id { set; get; }

        public string Name { set; get; }

        public string Note { set; get; }

        public int ParentId { set; get; }

        public List<CategoryEntity> SubCategories { get; set; }

        public CategoryEntity()
        {
            SubCategories = new List<CategoryEntity>();
        }

        public UICategoryModels ToUICategoryModels(IEnumerable<UICategoryModels> subCategories)
        {
            return (new UICategoryModels
            {
                Id = this.Id,
                Name = this.Name,
                Subcategories = subCategories
            });
        }
    }
}
